#pragma once

#define SIZE 1024
#define FLUSH_NONE 0
#define FLUSH_LINE 1
#define FLUSH_FULL 2

struct IO_FILE
{
    int flag; //刷新方式
    int fileno; //文件描述符
    char outbuffer[SIZE];//用户缓冲区
    int size;
    int cap;
    //TODO...
};

typedef struct IO_FILE MYFILE;

MYFILE *mfopen(const char *filename,const char *mode);
void mfflush(MYFILE*stream);
int mfwrite(const void *ptr,int num,MYFILE*stream);
void mfclose(MYFILE*stream);
